package cn.flying.cloud.flow.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;

import cn.flying.cloud.flow.bo.FwProcAttributeBo;

/**
 * 流程属性信息表
 *
 * @author admin
 * @since 2025-09-24 22:32:54
 */
@TableName("fw_proc_attribute")
public class FwProcAttribute implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 事件类型
     */
    @TableField("event_type")
    private String eventType;

    /**
     * 节点名称
     */
    @TableField("node_name")
    private String nodeName;

    /**
     * 节点ID
     */
    @TableField("node_id")
    private String nodeId;

    /**
     * 回调地址
     */
    @TableField("callback_url")
    private String callbackUrl;

    /**
     * 属性名
     */
    @TableField("attr_name")
    private String attrName;

    /**
     * 属性值
     */
    @TableField("attr_value")
    private String attrValue;

    /**
     * 流程定义ID
     */
    @TableField("proc_def_id")
    private String procDefId;

    /**
     * 流程定义key
     */
    @TableField("proc_def_key")
    private String procDefKey;

    /**
     * 备注
     */
    @TableField("remark")
    private String remark;

    /**
     * 扩展字段1
     */
    @TableField("ext1")
    private String ext1;

    /**
     * 扩展字段2
     */
    @TableField("ext2")
    private String ext2;

    /**
     * 扩展字段3
     */
    @TableField("ext3")
    private String ext3;

    /**
     * 创建人
     */
    @TableField(value = "created_by", fill = FieldFill.INSERT)
    private String createdBy;

    /**
     * 创建时间
     */
    @TableField(value = "created_time", fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    /**
     * 更新人
     */
    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    private String updatedBy;

    /**
     * 更新时间
     */
    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedTime;

    /**
     * 租户号
     */
    @TableField("tenant_id")
    private String tenantId;

    /**
     * 乐观锁
     */
    @TableField(value = "revision", fill = FieldFill.INSERT)
    @Version
    private Long revision;

    /**
     * 删除标识
     */
    @TableField(value = "deleted", fill = FieldFill.INSERT)
    @TableLogic
    private String deleted;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public String getCallbackUrl() {
        return callbackUrl;
    }

    public void setCallbackUrl(String callbackUrl) {
        this.callbackUrl = callbackUrl;
    }

    public String getAttrName() {
        return attrName;
    }

    public void setAttrName(String attrName) {
        this.attrName = attrName;
    }

    public String getAttrValue() {
        return attrValue;
    }

    public void setAttrValue(String attrValue) {
        this.attrValue = attrValue;
    }

    public String getProcDefId() {
        return procDefId;
    }

    public void setProcDefId(String procDefId) {
        this.procDefId = procDefId;
    }

    public String getProcDefKey() {
        return procDefKey;
    }

    public void setProcDefKey(String procDefKey) {
        this.procDefKey = procDefKey;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getExt1() {
        return ext1;
    }

    public void setExt1(String ext1) {
        this.ext1 = ext1;
    }

    public String getExt2() {
        return ext2;
    }

    public void setExt2(String ext2) {
        this.ext2 = ext2;
    }

    public String getExt3() {
        return ext3;
    }

    public void setExt3(String ext3) {
        this.ext3 = ext3;
    }

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public LocalDateTime getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    public LocalDateTime getUpdatedTime() {
        return updatedTime;
    }

    public void setUpdatedTime(LocalDateTime updatedTime) {
        this.updatedTime = updatedTime;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public Long getRevision() {
        return revision;
    }

    public void setRevision(Long revision) {
        this.revision = revision;
    }

    public String getDeleted() {
        return deleted;
    }

    public void setDeleted(String deleted) {
        this.deleted = deleted;
    }

    @Override
    public String toString() {
        return "FwProcAttribute{" +
                "id = " + id +
                ", eventType = " + eventType +
                ", nodeName = " + nodeName +
                ", nodeId = " + nodeId +
                ", callbackUrl = " + callbackUrl +
                ", attrName = " + attrName +
                ", attrValue = " + attrValue +
                ", procDefId = " + procDefId +
                ", procDefKey = " + procDefKey +
                ", remark = " + remark +
                ", ext1 = " + ext1 +
                ", ext2 = " + ext2 +
                ", ext3 = " + ext3 +
                ", createdBy = " + createdBy +
                ", createdTime = " + createdTime +
                ", updatedBy = " + updatedBy +
                ", updatedTime = " + updatedTime +
                ", tenantId = " + tenantId +
                ", revision = " + revision +
                ", deleted = " + deleted +
                "}";
    }

    public FwProcAttributeBo toBO() {
        FwProcAttributeBo bo = new FwProcAttributeBo();
        bo.setId(this.id);
        bo.setEventType(this.eventType);
        bo.setNodeName(this.nodeName);
        bo.setNodeId(this.nodeId);
        bo.setCallbackUrl(this.callbackUrl);
        bo.setAttrName(this.attrName);
        bo.setAttrValue(this.attrValue);
        bo.setProcDefId(this.procDefId);
        bo.setProcDefKey(this.procDefKey);
        bo.setRemark(this.remark);
        bo.setExt1(this.ext1);
        bo.setExt2(this.ext2);
        bo.setExt3(this.ext3);
        bo.setCreatedBy(this.createdBy);
        bo.setCreatedTime(this.createdTime);
        bo.setUpdatedBy(this.updatedBy);
        bo.setUpdatedTime(this.updatedTime);
        bo.setTenantId(this.tenantId);
        bo.setRevision(this.revision);
        bo.setDeleted(this.deleted);
        return bo;
    }

    public FwProcAttribute fromBO(FwProcAttributeBo bo) {
        this.setId(bo.getId());
        this.setEventType(bo.getEventType());
        this.setNodeName(bo.getNodeName());
        this.setNodeId(bo.getNodeId());
        this.setCallbackUrl(bo.getCallbackUrl());
        this.setAttrName(bo.getAttrName());
        this.setAttrValue(bo.getAttrValue());
        this.setProcDefId(bo.getProcDefId());
        this.setProcDefKey(bo.getProcDefKey());
        this.setRemark(bo.getRemark());
        this.setExt1(bo.getExt1());
        this.setExt2(bo.getExt2());
        this.setExt3(bo.getExt3());
        this.setCreatedBy(bo.getCreatedBy());
        this.setCreatedTime(bo.getCreatedTime());
        this.setUpdatedBy(bo.getUpdatedBy());
        this.setUpdatedTime(bo.getUpdatedTime());
        this.setTenantId(bo.getTenantId());
        this.setRevision(bo.getRevision());
        this.setDeleted(bo.getDeleted());
        return this;
    }
}
